@extends('admin.layouts.app')

@section('right-content')
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>新增商品</legend>
    </fieldset>

    <form class="layui-form" action="" style="margin-right: 60%">
        <div class="layui-form-item">
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-block">
                <input type="text" name="item_name" value="" lay-verify="required" autocomplete="off" placeholder="请输入商品名称" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">商品编号</label>
            <div class="layui-input-inline">
                <input type="text" name="product_no" value="" lay-verify="required|number" autocomplete="off" placeholder="请输入商品编号" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">需要和爱贝支付后台商品编号对应</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">充值金额</label>
            <div class="layui-input-inline">
                <input type="text" name="price" value="" lay-verify="required" placeholder="请输入充值金额" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">获得筹码</label>
            <div class="layui-input-inline">
                <input type="text" name="gold" value="" lay-verify="required|number" placeholder="请输入获得筹码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">赠送筹码</label>
            <div class="layui-input-inline">
                <input type="text" name="gift_gold" value="0" lay-verify="number" placeholder="请输入赠送筹码" autocomplete="off" class="layui-input">
            </div>
        </div>

        {{-- <div class="layui-form-item">
            <label class="layui-form-label">vip经验</label>
            <div class="layui-input-inline">
                <input type="text" name="vip_score" value="" lay-verify="number" placeholder="请输入vip经验值" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">赠送经验</label>
            <div class="layui-input-inline">
                <input type="text" name="gift_vip_score" value="0" lay-verify="number" placeholder="请输入赠送vip经验值" autocomplete="off" class="layui-input">
            </div>
        </div> --}}

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">商品描述</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="note"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="text" name="order_id" value="0" lay-verify="" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">支付方式</label>
            <div class="layui-input-block">
                <input type="radio" name="pay_way" value="1" title="Android" checked>
                <input type="radio" name="pay_way" value="2" title="IOS" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="enable" value="1" lay-filter="enable" title="上线" checked>
                <input type="radio" name="enable" value="0" lay-filter="enable" title="下线">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="sub" data-url="{{ route('goods.store') }}">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
@endsection

@section('my-js')
<script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form;

        form.on('submit(sub)', function(data){
            var url = $(this).attr('data-url');
            commonAjaxSubmit(url, 'POST');

        })
    });
</script>
@endsection